// ml:run = $bin < input
// ml:opt = 0
// ml:ccf += -g
#include <iostream>
#include <sstream>
#include <vector>

using ll = long long;
ll const mo = 1000003;
ll n, k;

namespace tue
{
	std::string remove_leading_zero(std::string const & s)
	{
		int i = 0;
		int l = s.size();
		while (i < l && s[i] == '0') i++;
		if (i == l) i--;
		return std::string(s.begin() + i, s.end());
	}

	std::string to_string(int x)
	{
		std::ostringstream oss;
		oss << x;
		return oss.str();
	}

	struct big_integer;
	big_integer operator*(big_integer const & a, big_integer const & b);
	big_integer operator+(big_integer const & a, big_integer const & b);
	big_integer operator-(big_integer const & a, big_integer const & b);
	bool operator>(big_integer const & a, big_integer const & b);

	struct big_integer
	{
		big_integer(std::string const & num) : num(remove_leading_zero(num)) {}
		big_integer(int x) : num(to_string(x)) {}
		big_integer() {}

		std::string value() const { return num; }
        int last()
        {
            return num[num.size() - 1] - '0';
        }

	private:
		std::string num;
	};

	std::ostream & operator<<(std::ostream & os, big_integer const & a)
	{
		os << a.value();
		return os;
	}

	big_integer operator*(big_integer const & a, big_integer const & b)
	{
		std::string const & s1 = a.value();
		std::string const & s2 = b.value();
		int l1 = s1.size();
		int l2 = s2.size();
		std::vector<int> s(2 * (l1 + l2));
		int l = 2 * (l1 + l2);
		for (int i = 0; i < l1; i++)
			for (int j = 0; j < l2; j++)
				s[l - i - j - 1] += (s1[l1 - i - 1] - '0') * (s2[l2 - j - 1] - '0');
		for (int i = 0; i < l; i++)
			if (s[l - i - 1] > 9) {
				int t = s[l - i - 1];
				s[l - i - 2] += t / 10;
				s[l - i - 1]  = t % 10;
			}
		std::string ts(2 * (l1 + l2), '0');
		for (int i = 0; i < 2 * (l1 + l2); i++)
			ts[i] += s[i];
		return big_integer(ts);
	}

	big_integer operator/(big_integer const & a, int b)
	{
		std::string const & s1 = a.value();
		int l1 = s1.size() + 1;
		std::vector<int> s(l1 + 4);
		for (int i = 1; i < l1; i++) s[i] = s1[i - 1] - '0';
		for (int i = 0; i < l1; i++) {
            s[i + 1] += (s[i] % 2) * 10;
            s[i] /= 2;
		}
		std::string ret(l1, '0');
		for (int i = 0; i < l1; i++) ret[i] += s[i];
		return big_integer(ret);
	}

	big_integer operator+(big_integer const & a, big_integer const & b)
	{
		std::string const & s1 = (a > b) ? a.value() : b.value();
		std::string const & s2 = (a > b) ? b.value() : a.value();
		int l1 = s1.size() + 1;
		int l2 = s2.size();
		std::vector<int> s(l1);
		for (int i = 1; i < l1; i++) s[i] = s1[i - 1] - '0';
		for (int i = 0; i < l2; i++) {
			s[l1 - i - 1] += s2[l2 - i - 1] - '0';
			if (s[l1 - i - 1] > 9) {
				s[l1 - i - 1] -= 10;
				s[l1 - i - 2]++;
			}
		}
		std::string ret(l1, '0');
		for (int i = 0; i < l1; i++) ret[i] += s[i];
		return big_integer(ret);
	}

	big_integer operator-(big_integer const & a, big_integer const & b) // assume a > b
	{
		std::string const & s1 = a.value();
		std::string const & s2 = b.value();
		int l1 = s1.size();
		int l2 = s2.size();
		std::vector<int> s(l1);
		for (int i = 0; i < l1; i++) s[i] = s1[i] - '0';
		for (int i = 0; i < l2; i++) {
			s[l1 - i - 1] -= s2[l2 - i - 1] - '0';
			if (s[l1 - i - 1] < 0) {
				s[l1 - i - 1] += 10;
				s[l1 - i - 2]--;
			}
		}
		std::string ret(l1, '0');
		for (int i = 0; i < l1; i++) ret[i] += s[i];
		return big_integer(ret);
	}

	bool operator>(big_integer const & a, big_integer const & b)
	{
		std::string const & s1 = a.value();
		std::string const & s2 = b.value();
		int i = 0, j = 0;
		for (; s1[i] == '0'; i++);
		for (; s2[j] == '0'; j++);
		int l1 = s1.size(), l2 = s2.size();
		if (l1 - i != l2 - j) return l1 - i > l2 - j;
		for (int t = 0; t + i < l1 && t + j < l2; t++)
			if (s1[t + i] != s2[t + j])
				return s1[t + i] > s2[t + j];
		return false;
	}

	ll big_quick(big_integer b)
	{
		if (b.value() == "0") return 1;
		ll ret = big_quick(b / 2);
		ret = (ret * ret) % mo;
		if (b.last() & 1) ret = (ret * 2) % mo;
		return ret % mo;
	}
}

tue::big_integer calc(ll k, ll n)
{
    tue::big_integer ret(0);
    while (n > 0) {
        if (!(k & 1)) k--;
        ret = ret + tue::big_integer(((k - 1) / 2) + 1);
        /* std::cout << ret.value() << "\n"; */
        n--; k = (k - 1) / 2 + 1;
    }
    return ret;
}

ll q2n;

ll quick(int x)
{
    if (!x) return 1;
    ll ret = quick(x / 2);
    ret = (ret * ret) % mo;
    if (x & 1) ret = (ret * 2) % mo;
    return ret;
}

ll calc_m(ll l, ll r)
{
    if (l < r) return 0;
    if (l == r) return (q2n - l) % mo;
    ll mid = (l + r) / 2;
    ll tl = calc_m(l, mid - 1);
    ll tr = calc_m(mid, r);
    return (tl * tr) % mo;
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    q2n = quick(n);
    std::cin >> n >> k;
    tue::big_integer a = tue::big_integer(k) * tue::big_integer(n);
    tue::big_integer tmp = calc(k, n);
    a = a - tmp;
    ll A = calc_m(k - 1, 0);
    std::cout << A << "\n";
    ll tt = (tue::big_quick(tmp)) % mo;
    A = (A * tt) % mo;
    ll B = ((tue::big_quick(a - tmp))) % mo;
    A = (((B - A) % mo) + mo) % mo;
    std::cout << A << " " << B << "\n";
}

